package com.xsir.ditan.miniprogram.common;

/**
 * @author user
 * @date 2021/1/28
 */
public enum ResultStatus {
    /**
     * 成功状态码
     */
    SUCCESS(200, "请求成功"),
    /* 参数错误：1001-1999 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_ERROR(1003, "参数类型错误"),
    /* 用户错误：2001-2999 */
    USER_NOT_LOGGED_IN(2001, "用户未登录"),
    UNKNOWN_ACCOUNT(2002, "账号不存在"),
    PASSWORD_ERROR(2003, "密码错误"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_ALREADY_EXIST(2005, "用户已存在");
    
    
    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 状态信息
     */
    private final String msg;
    
    ResultStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    
    public Integer code() {
        return code;
    }
    
    public String msg() {
        return msg;
    }
}
